﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DeviceTree"
    targetNamespace="http://tempuri.org/DeviceTree.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/DeviceTree.xsd"
    xmlns:mstns="http://tempuri.org/DeviceTree.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>

  <xs:simpleType name="Type-CoordinatesString">
    <xs:restriction base="xs:string">
      <xs:minLength value="12" />
      <xs:maxLength value="12" />
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="Regions">    
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="6" name="Region">          
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="1" name="RegionName" type="xs:string"/>
              <xs:element maxOccurs="unbounded" minOccurs="0" name ="RTPS">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="RTPSName" type="xs:string"/>
                    <xs:element name="BLR" type="xs:string"/>
                    <xs:element name="Coordinates" type="Type-CoordinatesString"/>
                    <xs:element maxOccurs="unbounded" name="Devices" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="DeviceName" type="xs:string"/>
                          <xs:element name="IpAddress" type="xs:string"/>
                        </xs:sequence>                        
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>                  
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>          
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
</xs:schema>
